﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Diablo3.Engine.Property
{
    /// <summary>
    /// 伤害
    /// </summary>
    public class Damage : ItemsProperty, IAffecteMinDamage, IAffecteMaxDamage
    {
        public Damage() { }

        public Damage(Double minValue, Double maxValue)
        {
            MinValue = minValue;
            MaxValue = maxValue;
        }

        /// <summary>
        /// 最小值
        /// </summary>
        public Double MinValue { get; set; }

        /// <summary>
        /// 伤害范围
        /// </summary>
        public Double MaxValue { get; set; }

        public override string Des
        {
            get { return String.Format("+{0}-{1} 伤害", MinValue, MaxValue); }
        }

        #region IAffecteMinDamage 成员

        double IAffecteMinDamage.Affecte(double source)
        {
            return source + MinValue;
        }

        #endregion

        #region IAffecteMaxDamage 成员

        double IAffecteMaxDamage.Affecte(double source)
        {
            return source + MaxValue;
        }

        #endregion
    }
}
